/**
 * Created by John on 2016/7/18.
 */
var mongo = new Mongo('localhost');
var db = mongo.getDB('admin');

db.runCommand({
    renameCollection: 'BeginningMongoDB_Copy2.word_stats2',
    to: 'BeginningMongoDB_Copy.word_stats',
    dropTarget:true
});

db = mongo.getDB('BeginningMongoDB_Copy');
var count = db.getCollection("word_stats").find().count();
print(count);